/**
 * Copyright(C) 2012 Luvina Software Company
 *
 * TblUserLogic.java, 28/12/2012, bacdv
 */
package net.luvina.manageuser.logic;

import java.util.List;

import net.luvina.manageuser.dto.UserDetailDto;
import net.luvina.manageuser.hibernate.TblUser;

/**
 * interface logic of TblUser
 *
 * @author bacdv
 *
 */
public interface TblUserLogic {
	/**
	 * get list user in DB
	 *
	 * @param offset
	 *            offset
	 * @param limit
	 *            limit
	 * @param groupId
	 *            groupId
	 * @param fullName
	 *            fullName
	 * @param sortType
	 *            sortType
	 * @param sortByFullName
	 *            sortByFullName
	 * @param sortByCodeLevel
	 *            sortByCodeLevel
	 * @param sortByEndDate
	 *            sortByEndDate
	 * @return List<UserDetailDto> list user
	 */
	public List<UserDetailDto> getListUser(int offset, int limit, int groupId,
			String fullName, String sortType, String sortByFullName,
			String sortByCodeLevel, String sortByEndDate);

	/**
	 * getTotalRecords
	 *
	 * @param groupId
	 *            groupId
	 * @param fullName
	 *            fullName
	 * @return Integer total records
	 */
	public int getTotalRecords(int groupId, String fullName);

	/**
	 * createUser
	 *
	 * @param tblUser
	 *            tblUser
	 * @return true if create success/ false if not success
	 */
	public boolean createUser(TblUser tblUser);

	/**
	 * updateUser
	 *
	 * @param tblUser
	 *            tblUser
	 * @return true if update success/ false if not success
	 */
	public boolean updateUser(TblUser tblUser);

	/**
	 * deleteUser
	 *
	 * @param tblUser
	 *            tblUser
	 * @return true if delete success/ false if not success
	 */
	public boolean deleteUser(TblUser tblUser);

	/**
	 * getUserById
	 *
	 * @param userId
	 *            userId
	 * @return TblUser
	 */
	public TblUser getUserById(int userId);

	/**
	 * getDetailUserById
	 *
	 * @param userId
	 *            userId
	 * @return UserDetailDto
	 */
	public UserDetailDto getDetailUserById(int userId);

	/**
	 * checkExistedEmail
	 *
	 * @param userId
	 *            userId
	 * @param email
	 *            email
	 * @return boolean true if exist/ false if not exist
	 */
	public boolean checkExistedEmail(int userId, String email);

	/**
	 * checkExistedLoginName
	 *
	 * @param userId
	 *            userId
	 * @param email
	 *            email
	 * @return boolean true if exist/ false if not exist
	 */
	public boolean checkExistedLoginName(int userId, String loginName);
}
